#pragma once
#include "ErrorMessage.h"

CErrorMessage::CErrorMessage(void)
{
}


CErrorMessage::~CErrorMessage(void)
{
}

void CErrorMessage::getErrorMessage(int code)
{
	QMessageBox msgBox;

	QString errorString = "During the execution of the program was an error with the code: ";
	if (code == -1) errorString.append("unknown error with value \"-1\"");
	else
	{
		QString additionalCode = QString::number(code);
		errorString.append(additionalCode);
	}
	
	msgBox.setText(errorString);
	msgBox.setCaption("Error!");
	msgBox.setIcon(QMessageBox::Critical);
	msgBox.exec();
}

void CErrorMessage::getErrorMessage(QString text)
{
	QMessageBox msgBox;

	QString errorString = "During the execution of the program was an error";

	msgBox.setText(errorString);
	msgBox.setInformativeText(text);
	msgBox.setCaption("Error!");
	msgBox.setIcon(QMessageBox::Critical);
	msgBox.exec();
}